﻿
<%@ Page language="c#" Inherits="Mysoft.Crm.Dialogs.DeleteCustomerConfirmationPage" CodeBehind="Mysoft.Crm.Application.Pages.Grids.dll" %>
<%@ Register TagPrefix="frm" Namespace="Mysoft.Crm.Application.Forms" Assembly="Mysoft.Crm.Application.Components" %>
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Crm.Application.Controls" Assembly="Mysoft.Crm.Application.Components" %>
<html>
<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"/>
<title>Select Delete or Deactivate</title>
<cnt:AppHeader id="crmHeader" runat="server" />
<script language="JavaScript" src="multiAction.js"></script>
<script language="JavaScript">

    // Globals for Action
    var _sAction = "delete";
    var _iStep = <%=(355 / iTotal)%>;
    var _iObjType = "<%= ObjType %>";
   
    function button_delete()
    {
		// Confirm that the user wants to delete records
		oResult = openStdDlg( "dlg_confirm_delete.aspx?ObjectTypeId=" + _iObjType + "&iTotal=" + <%=iTotal%>, null, 350, 200 );
		
		if( oResult )
		{	
			prepUI();
			_bActionStarted = true;
			_sAction = "delete";  // override the default action.
			performAction();
		}
    }
   
    function button_deactivate()
    {
		prepUI();
	
		_bActionStarted = true;
		_sAction = "deactivate";   // override the default action.
		performAction();
   }
   
   function prepUI()
   {
		// This code was replicated from multiAction.js because it's design
		// did not support running different actions depending on user input.
		// Ideally the multiAction.js should be changed to depend less on global variables
		// but since it is used in so many locations I'd rather not make that kind of change
		// at this point in the cycle.
   		cmdDialogDelete.disabled		= true;
   		cmdDialogDeactivate.disabled	= true;
		divWarning.style.display		= "none";
		divFillBg.style.display			= "inline";
		divStatus.style.display			= "inline";
		divFill.style.display			= "inline";
   }
   
</script>
</head>

<body>

	<frm:DialogForm id="crmForm" runat="server">

        Deleting the <%=ObjNamePlural%> you selected will cause all other records under the deleted <%=ObjNamePlural%> to be deleted as well (e.g. opportunities, cases, activities, etc.). To keep the items under the selected <%=ObjNamePlural%> available for further use and/or reporting, it is recommended that you set the <%=ObjNamePlural%> to inactive instead.

	</frm:DialogForm>

</body>
</html>